package work.gac.unbind.v2.unbinder;

import lombok.extern.slf4j.Slf4j;
import work.gac.unbind.v2.DatalakUtil;

/**
 * @author Gong.Yang
 */
@Slf4j
public class GacHWJFUnbind implements Unkinder {
    private static final String fromSocialCode = "阿玛尼-71B-火舞肌肤检测";

    @Override
    public boolean match(String tag) {
        return tag.contains(fromSocialCode);
    }

    @Override
    public Runnable process(String thirdCode, String mobile) {
        return () -> {
            String openId = DatalakUtil.getOpenId(mobile, fromSocialCode);
            DatalakUtil.unbind(mobile, openId);
        };
    }
}
